from common.api.tornado_handler import RequestHandler
from web_module import security


class SecurityHandler(RequestHandler):

    def post(self, *args, **kwargs):
        step = self.get_argument('step')
        pk = self.get_argument('pk', default=None)
        self.session.session_id = '__session_' + self.request.headers.get('session_id')
        result = security.request_pk(step=step, session=self.session, pk=pk)
        self.write(result)
